<template>
  <!-- 排行榜 -->
  <div class="rank">
    <div class="rank-in banxin2 tanxin">
      <div class="rank-l" style="width: 240px; height: 2410px">
        <div class="title">
          <h3 style="font-size: 16px">云音乐特色榜</h3>
        </div>
        <ul style="margin-top: 20px" class="ul1">
          <li v-for="item in this.cloudMusic" :key="item.id">
            <a href="#" class="tanxin">
              <img width="40" height="40" :src="item.coverImgUrl" alt />
              <div class="neirong">
                <p>{{ item.name }}</p>
                <p class="s-fc4">{{ item.updateFrequency }}</p>
              </div>
            </a>
          </li>
        </ul>
        <div class="title" style="margin-top: 30px">
          <h3 class="title" style="font-size: 16px">全球媒体榜</h3>
        </div>
        <ul>
          <li v-for="item1 in this.world" :key="item1.id">
            <a href="#" class="tanxin">
              <img width="40" :src="item1.coverImgUrl" alt />
              <div class="neirong">
                <p>{{ item1.name }}</p>
                <p class="s-fc4">{{ item1.updateFrequency }}</p>
              </div>
            </a>
          </li>
        </ul>
      </div>

      <div class="rank-r">
        <div class="box2">
          <div class="rank-r-t tanxin">
            <img width="150" :src="Playlist.coverImgUrl" alt />
            <div class="box2-r">
              <p class="p-1">{{ Playlist.name }}</p>
              <p class="p-2">
                {{ Playlist.description }}
                <span>（刚刚更新）</span>
              </p>
              <div class="tubiao">
                <ul>
                  <li>
                    <button>播放</button>
                  </li>
                  <li>
                    <button>添加</button>
                  </li>
                  <li>
                    <button>分享</button>
                  </li>
                  <li>
                    <button>下载</button>
                  </li>
                  <li>
                    <button>评论</button>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
        <div class="rank-t">
          <!-- 歌曲列表 -->
          <div class="rank-c1 tanxin">
            <h3>歌曲列表</h3>
            <span>100首歌</span>
            <div class="cishu">
              播放:
              <strong class="s-fc6">5203650560</strong> 次
            </div>
          </div>
          <div class="rank-c2">
            <table>
              <thead>
                <tr>
                  <th class="w1"></th>
                  <th class="w2">
                    <div class="wp">标题</div>
                  </th>
                  <th class="w3">
                    <div class="wp">时长</div>
                  </th>
                  <th class="w4">
                    <div class="wp">歌手</div>
                  </th>
                </tr>
              </thead>
              <tbody>
                <tr class="even" v-for="(item, index) in Playlist.tracks" :key="item.id">
                  <td class="ran tanxin">
                    <span class="s1">{{ index + 1 }}</span>
                    <span class="s2"></span>
                  </td>
                  <td class="rand">
                    <div class="f-cb">
                      <a href="#">
                        <img width="50" :src="item.al.picUrl" alt />
                      </a>
                      <span class="bf">&nbsp;</span>
                      <b class="gm">{{ item.name }}</b>
                    </div>
                  </td>
                  <td class="s-fc3">
                    <span class="time">{{ item.dt }}</span>
                  </td>
                  <td class="s-fc4">
                    <div class="text">
                      <span title>
                        <a href="#">{{ item.ar[0].name }}</a>
                      </span>
                    </div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <!-- 评论 -->
          <div class="rank-c3">
            <div class="m-b">
              <div class="u-title u-title-1">
                <h3>
                  <span class="f-ff2">评论</span>
                </h3>
                <span class="sub s-fc3">
                  共
                  <span class="j-flag">0</span>
                  条评论
                </span>
              </div>
              <div class="m-cmmt">
                <div class="iptarea">
                  <div class="head">
                    <img src alt />
                  </div>
                  <div class="headr-t">
                    <div class="u-txtwrap holder-parent f-pr">
                      <textarea class="u-txt area j-flag" placeholder="评论"></textarea>
                    </div>
                  </div>
                  <div class="headr-b">
                    <i class="icn u-icn u-icn-36 j-flag"></i>
                    <i class="icn u-icn u-icn-37 j-flag"></i>
                    <a href="javascript" class="btn u-btn u-btn-1 j-flag">评论</a>
                    <span class="zs s-fc4 j-flag">140</span>
                  </div>
                </div>
                <div class="corr u-arr">
                  <em class="arrline">◆</em>
                  <span class="arrclr">◆</span>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { ToplistAPi, PlaylistAPi } from "@/request/api";
export default {
  data() {
    return {
      cloudMusic: [],
      world: [],
      Playlist: []
    };
  },
  created() {
    ToplistAPi().then(res => {
      this.cloudMusic = res.data.list.slice(0, 4);
      console.log("toplist", this.cloudMusic);
      this.world = res.data.list.slice(4, 37);
      console.log("world", this.world);
      let a = res.data.list[0].id;
      console.log(a);
      PlaylistAPi(a).then(res => {
        this.Playlist = res.data.playlist;
        console.log("playlist", this.Playlist);
      });
    });
  }
};
</script>
 
<style lang = "less" scoped>
@import "../assets//base.less";
* {
  font-size: 12px;
  text-decoration: none;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rank {
  .rank-in {
    justify-content: start;
    border: 1px solid #000;
    .rank-l {
      padding-top: 30px;

      .title {
        font-weight: bold;
        padding-left: 10px;
      }
      ul {
        margin-top: 10px;

        li {
          width: 240px;
          height: 62px;
          align-items: center;
          a {
            padding-left: 20px;
            justify-content: start;
            align-items: center;
            height: 50px;
            &:hover {
              background-color: #ccc;
            }
            img {
              width: 40px;
              height: 40px;
            }
            .neirong {
              margin-left: 10px;
            }
          }
        }
      }
    }
    .rank-r {
      width: 738px;
      .box2 {
        padding: 40px 0 0 40px;
        display: flex;
        img {
          border: 1px solid #ccc;
          width: 150px;
          height: 150px;
        }
        .box2-r {
          margin-left: 30px;
          .p-1 {
            font-size: 20px;
            margin-top: 20px;
          }
          .p-2 {
            margin-top: 20px;
            span {
              color: rgb(212, 212, 212);
            }
          }
          .tubiao {
            margin-top: 30px;
            width: 483px;
            ul {
              display: flex;
              li {
                margin: 0 3px;
                button {
                  color: #fff;
                  background-color: #ccc;
                  padding: 5px 10px;
                  border: none;
                  border-radius: 5px;
                }
              }
            }
          }
        }
      }
      .rank-t {
        margin-top: 50px;
        padding-left: 30px;
        .rank-c1 {
          align-items: center;
          h3 {
            font-size: 23px;
          }
          span {
            font-size: 16px;
            transform: translateX(-150px);
            color: #ccc;
          }
          .cishu {
            font-size: 14px;
            strong {
              font-weight: bold;
              font-size: 16px;
            }
          }
          padding-bottom: 10px;
          border-bottom: 3px solid #333;
        }
        .rank-c2 {
          table {
            background-color: #fff;
            border: 1px solid #d9d9d9;
            width: 100%;
            thead {
              height: 38px;
              line-height: 38px;
              border-bottom: 2px solid #ccc;
              tr {
                th {
                  height: 35px;
                  background-color: #f7f7f7;
                  line-height: 35px;
                }
                .w1 {
                  width: 77px;
                  height: 38px;
                  border-right: 1px solid #ccc;
                }
                .w2 {
                  width: 326px;
                  height: 34px;
                }
                .wp {
                  float: left;
                  height: 18px;
                  line-height: 18px;
                  padding: 8px 10px;
                  background-position: 0 -56px;
                  font-weight: normal;
                  font-size: 12px;
                  color: #666;
                }
                .w3 {
                  border-left: 1px solid #ccc;
                  width: 70px;
                  border-right: 1px solid #ccc;
                }
              }
            }
            tbody {
              .even {
                .ran {
                  transform: translateY(-20px);
                  text-align: center;
                  justify-content: center;
                  align-items: center;
                  .s1 {
                    margin-right: 20px;
                    font-size: 13px;
                  }
                  .s2 {
                    background: url("https://s2.music.126.net/style/web2/img/icon.png?ad18893948ba610ea1ef8778bffb8dbd")
                      no-repeat 0 9999px;
                    width: 16px;
                    height: 17px;
                    background-position: -67px -283px;
                  }
                }
                .rand {
                  .f-cb {
                    margin-top: 8px;
                    display: flex;
                    align-items: center;
                    a {
                      width: 50px;
                      height: 50px;
                    }
                  }
                }
                .s-fc3 {
                  transform: translateY(-20px);
                  text-align: center;
                  font-size: 13px;

                  display: inline-block;
                }
                .s-fc4 {
                  transform: translateY(-20px);
                  height: 70px;
                }
              }
            }
          }
        }
        .rank-c3 {
          margin-top: 40px;

          .u-title {
            height: 33px;
            border-bottom: 2px solid #c20c0c;
            padding: 0 10px 0 32px;

            h3 {
              float: left;
              font-size: 20px;
              line-height: 28px;
              font-weight: normal;

              .f-ff2 {
                font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
              }
            }

            .sub {
              margin: 9px 0 0 20px;
            }

            .s-fc3 {
              font-size: 12px;
              color: #333;
              float: left;
            }
          }

          .m-cmmt {
            position: relative;
            margin-top: 20px;
            margin-left: 32px;
            margin-right: 32px;

            .iptarea {
              margin-bottom: 20px;

              .head {
                float: left;
                width: 50px;
                height: 50px;
                margin-right: -100px;

                img {
                  // float: left;
                  width: 50px;
                  height: 50px;
                  margin-right: -100px;
                }
              }

              .headr-t {
                float: left;
                margin-left: 70px;

                textarea {
                  outline: none;
                  width: 600px;
                  overflow: auto;
                  font-size: 12px;
                  color: #333;
                  font-family: Arial, Helvetica, sans-serif;
                  padding: 5px 6px 6px;
                  border: 1px solid #cdcdcd;
                  border-radius: 2px;
                  line-height: 19px;
                  box-sizing: content-box;
                  resize: none;
                }
              }

              .headr-b {
                margin-left: 68px;
                padding-top: 10px;

                .icn {
                  float: left;
                  margin: 0px 10px 0 0;
                  cursor: pointer;
                }

                .u-icn-36 {
                  display: block;
                  width: 18px;
                  height: 18px;
                  background: url(../assets/image/icon.png) no-repeat -40px -490px;
                }

                .u-icn-37 {
                  width: 18px;
                  height: 18px;
                  background: url(../assets/image/icon.png) no-repeat -60px -490px;
                }

                .btn {
                  float: right;
                }

                .s-fc4 {
                  color: #999;
                  font-size: 12px;
                  float: right;
                  margin-right: 10px;
                  line-height: 25px;
                }

                .u-btn-1 {
                  display: inline-block;
                  width: 46px;
                  height: 25px;
                  color: #fff;
                  text-align: center;
                  line-height: 25px;
                  background: url(../assets/image/button.png) no-repeat -84px -64px;
                }
              }
            }

            .corr {
              position: absolute;
              top: 10px;
              left: 63px;
              width: 13px;
              height: 14px;
              overflow: hidden;

              .arrline {
                display: block;
                font-family: "SimSun";
                font-size: 15px;
                font-style: normal;
                font-weight: normal;
                height: 10px;
                line-height: normal;
                color: #efefef;
              }

              .arrclr {
                display: block;
                font-family: "SimSun";
                font-size: 15px;
                font-style: normal;
                font-weight: normal;
                height: 10px;
                line-height: normal;
                color: #fff;
              }
            }
          }
        }
      }
    }
  }
}
</style>